<script setup>
	function request() {
		uni.showLoading()
		uni.request({
			url: "https://jsonplaceholder.typicode.com/posts",
			data: {
				id: 5
			},
			header: {
				token: "asdfg",
				"content-type": "application/x-www-form-urlencoded"
			},
			method: "POST",
			timeout:2000,
			success: res => {
				console.log(res);
			},
			fail: err => {
				console.log("超时")
				console.log(err);
			},
			complete: () => {
				uni.hideLoading()
			}
		})
	}
	request();
</script>
<template>
	<view class="">

	</view>
</template>
<style lang="scss" scoped>

</style>